#ifndef BSP_SHOWWORLD_H
#define BSP_SHOWWORLD_H
#include <stdio.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "driver/gpio.h"
#include "esp_log.h"
#include "esp_timer.h"
#include "esp_mac.h"

#define TOTAL_WOLD 20

#define HT_HEAD 0X5A
#define HT_TAIL 0XA5
extern QueueHandle_t vocabulary_index_queue;

typedef struct
{
 uint8_t head;// 0x5a
 uint8_t HT_CH; // 三个HT单片机 第一
 uint8_t CELL_CH :2; // 一个HT有两个CELL，第一个为1
 uint8_t CELL_0 :1;
 uint8_t CELL_1 :1; // | 0 | 3 |
 uint8_t CELL_2 :1; // | 1 | 4 |
 uint8_t CELL_3 :1; // | 2 | 5 |
 uint8_t CELL_4 :1;
 uint8_t CELL_5 :1;
 uint8_t tail; // 0xa5

 uint8_t _2_head; //0x5a
 uint8_t _2_HT_CH;//三个HT单片机 第一个为1
 uint8_t _2_CELL_CH:2;//一个HT有两个CELL, 第一个为1
 uint8_t _2_pin_0 :1;
 uint8_t _2_pin_1 :1;
 uint8_t _2_pin_2 :1;
 uint8_t _2_pin_3 :1;
 uint8_t _2_pin_4 :1;
 uint8_t _2_pin_5 :1;
 uint8_t _2_tail; //0xa5        //设置如下|0 5| 
} esp_tx_t;

typedef enum {
    // A_CHAR = 100000,      // A
    // B_CHAR = 110000,      // B
    // C_CHAR = 100100,      // C
    // D_CHAR = 100110,      // D
    // E_CHAR = 100010,      // E
    // F_CHAR = 110100,      // F
    // G_CHAR = 110110,      // G
    // H_CHAR = 110010,      // H
    // I_CHAR = 010100,      // I
    // J_CHAR = 010110,      // J
    // K_CHAR = 101000,      // K
    // L_CHAR = 111000,      // L
    // M_CHAR = 101100,      // M
    // N_CHAR = 101110,      // N
    // O_CHAR = 101010,      // O
    // P_CHAR = 111100,      // P
    // Q_CHAR = 111110,      // Q
    // R_CHAR = 111010,      // R
    // S_CHAR = 011100,      // S
    // T_CHAR = 011110,      // T
    // U_CHAR = 101001,      // U
    // V_CHAR = 111001,      // V
    // W_CHAR = 010111,      // W
    // X_CHAR = 101101,      // X
    // Y_CHAR = 101111,      // Y
    // Z_CHAR = 101011,      // Z
    A_CHAR = 32,      //100000
    B_CHAR = 48,      //110000
    C_CHAR = 36,      //100100
    D_CHAR = 38,      //100110
    E_CHAR = 34,      //100010
    F_CHAR = 52,      //110100
    G_CHAR = 54,      //110110
    H_CHAR = 50,      //110010
    I_CHAR = 20,      //010100
    J_CHAR = 22,      //010110
    K_CHAR = 40,      //101000
    L_CHAR = 56,      //111000
    M_CHAR = 44,      //101100
    N_CHAR = 46,      //101110
    O_CHAR = 42,      //101010
    P_CHAR = 60,      //111100
    Q_CHAR = 62,      //111110
    R_CHAR = 58,      //111010
    S_CHAR = 28,      //011100
    T_CHAR = 30,      //011110
    U_CHAR = 41,      //101001
    V_CHAR = 57,      //111001
    W_CHAR = 23,      //010111
    X_CHAR = 45,      //101101
    Y_CHAR = 47,      //101111
    Z_CHAR = 43,      //101011
    BRAILLE_INVALID  = 100      // 无效编码标识
} BrailleCode_t;

void show_wold_init();
void show_index_wold_page(uint8_t show_index,uint8_t wold_page,uint8_t* len_of_wold,BrailleCode_t BrailleCode[20][20]);
#endif
